import request from '@/utils/request'

export const getAddressList = () => {
  return request.get('/address/list')
}

export const getAddressDefaultId = () => {
  return request.get('/address/defaultId')
}

export const setAddressDefaultId = (obj) => {
  return request.post('/address/setDefault', obj)
}

export const removeAddress = (obj) => {
  return request.post('/address/remove', obj)
}

export const addAddress = (obj) => {
  return request.post('/address/add', obj)
}

export const editAddress = (obj) => {
  return request.post('/address/edit', obj)
}

export const getAddressDetail = (addressId) => {
  return request.get('/address/detail', {
    params: { addressId }
  })
}

export const getRegionTree = () => {
  return request.get('/region/tree')
}
